[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
QTAwk allows the user to define functions which can accept a variable
number of parameters to be passed. The ellipses notation is used in
definition of the function. To define a function which may accept any
number of parameters and find the maximum value passed:
function max(...) {
local i, max = vargv[1];
for ( i in vargv ) if ( max < vargv[i] ) max = vargv[i];
return max;
}
The predefined variable 'vargc' is set to the number of arguments
passed on a particular invocation of the function. The
singly-dimensioned array 'vargv' has as its elements the parameters
passed. The subscripts of 'vargv' are numeric with values ranging from
1 to 'vargc'.
See Also:
Defining
Invoking
vargc
vargv
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson